<!-- 文件介绍：form2.html是通用的表单模板，input框分成两列 -->
{% extends 'layout.html' %}

{% block content %}
    <form method="post" novalidate>
        {% csrf_token %}

        {% for field in form %}
            <div class="col-xs-6" style="position: relative">
                <label>{{ field.label }}</label>
                {% if field.help_text %}
                    <span>（{{ field.help_text }}）</span>
                {% endif %}

                {{ field }}

                <span style="position: absolute;color: red;">{{ field.errors.0 }}</span>
            </div>
        {% endfor %}

        <button class="btn btn-primary" type="submit" style="margin: 30px 0 0 16px;">保存</button>
    </form>
{% endblock %}